package com.noble.library.permission.rationale;

import android.app.AlertDialog;
import android.content.Context;

import com.noble.library.R;
import com.noble.library.permission.andPermission.Rationale;
import com.noble.library.permission.andPermission.RequestExecutor;

import java.io.File;

/**
 * 安装应用权限拒绝，再次弹框提示
 */
public class InstallRationale implements Rationale<File> {

    @Override
    public void showRationale(Context context, File data, final RequestExecutor executor) {
        new AlertDialog.Builder(context)
                .setCancelable(false)
                .setTitle(R.string.tip)
                .setMessage(R.string.message_install_failed)
                .setPositiveButton(R.string.ok, (dialog, which) -> executor.execute())
                .setNegativeButton(R.string.cancel, (dialog, which) -> executor.cancel())
                .show();
    }
}